package flappy.Game;

import com.badlogic.gdx.*;

public class ManHinhChinh implements Screen {
	
	private GameWorld    game;
	private GameRenderer renderer;
	private float        runTime;

	public ManHinhChinh() {
		float screenWidth = Gdx.graphics.getWidth();
		float screenHeight = Gdx.graphics.getHeight();
		float gameWidth = 144;
		float gameHeight = screenHeight / (screenWidth / gameWidth);
		int midPointY = (int) (gameHeight / 2);
		
		game = new GameWorld(midPointY);
		Gdx.input.setInputProcessor(new InputHandler(game, screenWidth / gameWidth, screenHeight / gameHeight));
		renderer = new GameRenderer(game, (int) gameHeight, midPointY);
		game.renderer = renderer;
	}
	
	@Override
	public void render(float delta) {
		runTime += delta;
		game.update(delta);
		renderer.render(delta, runTime);
	}
	
	@Override
	public void resize(int width, int height) {}
	
	@Override
	public void show() {}
	
	@Override
	public void hide() {}
	
	@Override
	public void pause() {}
	
	@Override
	public void resume() {}
	
	@Override
	public void dispose() {}
	
}
